#!/usr/bin/python -tt

from Tkinter import *

def hello():
    print "hello!"

class App(Tk):
    def __init__(self):
        Tk.__init__(self)

    self['menu'] = mbar
    # create a Menu object
    mbar = Menu(self)
    # set this Menu to be the App window's menu bar


    # create another Menu object
    fileMenu = Menu(mbar)
    # set this Menu to be a submenu of the menu bar, under the name "File"
    mbar.add_cascade(label="File", menu=fileMenu)

    # add a command named "Hello" to the submenu, and have it
    # invoke the function "hello"
    fileMenu.add_command(label="Hello", command=hello)

app = App()
app.mainloop()